package com.sejong.andproject;

import android.app.Activity;
import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.view.KeyEvent;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class sendmessage extends Activity {
	
	private WebView webview01;
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.webviewing);
	    // TODO Auto-generated method stub
	    
	    
		TelephonyManager telManager = (TelephonyManager)this.getSystemService(this.TELEPHONY_SERVICE); 
		String phoneNum = telManager.getLine1Number();
	    
		
	    webview01 = (WebView)findViewById(R.id.webview01);
        
         
        webview01.getSettings().setJavaScriptEnabled(true); 
     
        webview01.loadUrl("http://comms2012.dothome.co.kr/project/message.php");
        
        webview01.setWebViewClient(new WebViewClientClass());  
        
        
	}
	 @Override
	    public boolean onKeyDown(int keyCode, KeyEvent event) { 
	        if ((keyCode == KeyEvent.KEYCODE_BACK) && webview01.canGoBack()) { 
	        	webview01.goBack(); 
	            return true; 
	        } 
	        return super.onKeyDown(keyCode, event);
	    }
	     
	    private class WebViewClientClass extends WebViewClient { 
	        @Override
	        public boolean shouldOverrideUrlLoading(WebView view, String url) { 
	            view.loadUrl(url); 
	            return true; 
	        } 
	        
	    }
}
